package com.springbooti18n.controll;

import com.springbooti18n.model.FormData;
import com.springbooti18n.model.Home;
import com.springbooti18n.validate.request.FormValidate;
import org.springframework.web.bind.annotation.*;

/**
 * xufan
 * 2019/1/16
 * https://www.liangzl.com/get-article-detail-19336.html
 */
@RestController
public class MyValidateTest {

    @PostMapping("/validate_test")
    public FormData validate_test(
            @RequestBody @FormValidate(beanName = "{formData.orgNo}") FormData formData ,
             @RequestHeader(required = false) String lang){
        System.out.println("aaaaaaaaaaaa");
        return formData;
    }

    @PostMapping("/validate_test111")
    public FormData validate_test111(
            @RequestBody FormData formData , @RequestBody Home home,
            @RequestHeader(required = false) String lang){
        System.out.println("aaaaaaaaaaaa");
        return formData;
    }

    @PostMapping("/validate_test1121")
    public FormData validate_test1121(
            @FormValidate(beanName = "{orgNo}") FormData formData ,
            @PathVariable String orgNo,
            @RequestHeader(required = false) String lang){
        System.out.println("aaaaaaaaaaaa");
        return formData;
    }
}
